3.3.90 \(\int (a+b \sin (c+\frac {d}{x})) \, dx\) [290]

Optimal. Leaf size=38 \[ a x-b d \cos (c) \text {Ci}\left (\frac {d}{x}\right )+b x \sin \left (c+\frac {d}{x}\right )+b d \sin (c) \text {Si}\left (\frac {d}{x}\right ) \]

[Out]

a*x-b*d*Ci(d/x)*cos(c)+b*d*Si(d/x)*sin(c)+b*x*sin(c+d/x)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3442, 3378, 3384, 3380, 3383} \begin {gather*} a x-b d \cos (c) \text {CosIntegral}\left (\frac {d}{x}\right )+b d \sin (c) \text {Si}\left (\frac {d}{x}\right )+b x \sin \left (c+\frac {d}{x}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[a + b*Sin[c + d/x],x]

[Out]

a*x - b*d*Cos[c]*CosIntegral[d/x] + b*x*Sin[c + d/x] + b*d*Sin[c]*SinIntegral[d/x]

Rule 3378

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(c + d*x)^(m + 1)*(Sin[e + f*x]/(d*(m
 + 1))), x] - Dist[f/(d*(m + 1)), Int[(c + d*x)^(m + 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && LtQ[
m, -1]

Rule 3380

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3383

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rule 3384

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[c*(f/d) + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3442

Int[((a_.) + (b_.)*Sin[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)])^(p_.), x_Symbol] :> Dist[1/(n*f), Subst[Int[x
^(1/n - 1)*(a + b*Sin[c + d*x])^p, x], x, (e + f*x)^n], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 0] && In
tegerQ[1/n]

Rubi steps

\begin {align*} \int \left (a+b \sin \left (c+\frac {d}{x}\right )\right ) \, dx &=a x+b \int \sin \left (c+\frac {d}{x}\right ) \, dx\\ &=a x-b \text {Subst}\left (\int \frac {\sin (c+d x)}{x^2} \, dx,x,\frac {1}{x}\right )\\ &=a x+b x \sin \left (c+\frac {d}{x}\right )-(b d) \text {Subst}\left (\int \frac {\cos (c+d x)}{x} \, dx,x,\frac {1}{x}\right )\\ &=a x+b x \sin \left (c+\frac {d}{x}\right )-(b d \cos (c)) \text {Subst}\left (\int \frac {\cos (d x)}{x} \, dx,x,\frac {1}{x}\right )+(b d \sin (c)) \text {Subst}\left (\int \frac {\sin (d x)}{x} \, dx,x,\frac {1}{x}\right )\\ &=a x-b d \cos (c) \text {Ci}\left (\frac {d}{x}\right )+b x \sin \left (c+\frac {d}{x}\right )+b d \sin (c) \text {Si}\left (\frac {d}{x}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 50, normalized size = 1.32 \begin {gather*} a x+b x \cos \left (\frac {d}{x}\right ) \sin (c)+b x \cos (c) \sin \left (\frac {d}{x}\right )-b d \left (\cos (c) \text {Ci}\left (\frac {d}{x}\right )-\sin (c) \text {Si}\left (\frac {d}{x}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[a + b*Sin[c + d/x],x]

[Out]

a*x + b*x*Cos[d/x]*Sin[c] + b*x*Cos[c]*Sin[d/x] - b*d*(Cos[c]*CosIntegral[d/x] - Sin[c]*SinIntegral[d/x])

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 43, normalized size = 1.13

method result size
default \(a x -b d \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x}{d}-\sinIntegral \left (\frac {d}{x}\right ) \sin \left (c \right )+\cosineIntegral \left (\frac {d}{x}\right ) \cos \left (c \right )\right )\) \(43\)
derivativedivides \(-d \left (-\frac {a x}{d}+b \left (-\frac {\sin \left (c +\frac {d}{x}\right ) x}{d}-\sinIntegral \left (\frac {d}{x}\right ) \sin \left (c \right )+\cosineIntegral \left (\frac {d}{x}\right ) \cos \left (c \right )\right )\right )\) \(48\)
risch \(a x -\frac {i {\mathrm e}^{-i c} \pi \,\mathrm {csgn}\left (\frac {d}{x}\right ) b d}{2}+i {\mathrm e}^{-i c} \sinIntegral \left (\frac {d}{x}\right ) b d +\frac {\expIntegral \left (1, -\frac {i d}{x}\right ) {\mathrm e}^{-i c} b d}{2}+\frac {{\mathrm e}^{i c} \expIntegral \left (1, -\frac {i d}{x}\right ) b d}{2}+b x \sin \left (\frac {c x +d}{x}\right )\) \(87\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*sin(c+d/x),x,method=_RETURNVERBOSE)

[Out]

a*x-b*d*(-sin(c+d/x)/d*x-Si(d/x)*sin(c)+Ci(d/x)*cos(c))

________________________________________________________________________________________

Maxima [C] Result contains complex when optimal does not.
time = 0.32, size = 65, normalized size = 1.71 \begin {gather*} -\frac {1}{2} \, {\left ({\left ({\left ({\rm Ei}\left (\frac {i \, d}{x}\right ) + {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \cos \left (c\right ) - {\left (-i \, {\rm Ei}\left (\frac {i \, d}{x}\right ) + i \, {\rm Ei}\left (-\frac {i \, d}{x}\right )\right )} \sin \left (c\right )\right )} d - 2 \, x \sin \left (\frac {c x + d}{x}\right )\right )} b + a x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(c+d/x),x, algorithm="maxima")

[Out]

-1/2*(((Ei(I*d/x) + Ei(-I*d/x))*cos(c) - (-I*Ei(I*d/x) + I*Ei(-I*d/x))*sin(c))*d - 2*x*sin((c*x + d)/x))*b + a
*x

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 52, normalized size = 1.37 \begin {gather*} b d \sin \left (c\right ) \operatorname {Si}\left (\frac {d}{x}\right ) + b x \sin \left (\frac {c x + d}{x}\right ) + a x - \frac {1}{2} \, {\left (b d \operatorname {Ci}\left (\frac {d}{x}\right ) + b d \operatorname {Ci}\left (-\frac {d}{x}\right )\right )} \cos \left (c\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(c+d/x),x, algorithm="fricas")

[Out]

b*d*sin(c)*sin_integral(d/x) + b*x*sin((c*x + d)/x) + a*x - 1/2*(b*d*cos_integral(d/x) + b*d*cos_integral(-d/x
))*cos(c)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + \frac {d}{x} \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(c+d/x),x)

[Out]

Integral(a + b*sin(c + d/x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 137 vs. \(2 (38) = 76\).
time = 4.06, size = 137, normalized size = 3.61 \begin {gather*} a x - \frac {{\left (c d^{2} \cos \left (c\right ) \operatorname {Ci}\left (-c + \frac {c x + d}{x}\right ) + c d^{2} \sin \left (c\right ) \operatorname {Si}\left (c - \frac {c x + d}{x}\right ) - \frac {{\left (c x + d\right )} d^{2} \cos \left (c\right ) \operatorname {Ci}\left (-c + \frac {c x + d}{x}\right )}{x} - \frac {{\left (c x + d\right )} d^{2} \sin \left (c\right ) \operatorname {Si}\left (c - \frac {c x + d}{x}\right )}{x} + d^{2} \sin \left (\frac {c x + d}{x}\right )\right )} b}{{\left (c - \frac {c x + d}{x}\right )} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sin(c+d/x),x, algorithm="giac")

[Out]

a*x - (c*d^2*cos(c)*cos_integral(-c + (c*x + d)/x) + c*d^2*sin(c)*sin_integral(c - (c*x + d)/x) - (c*x + d)*d^
2*cos(c)*cos_integral(-c + (c*x + d)/x)/x - (c*x + d)*d^2*sin(c)*sin_integral(c - (c*x + d)/x)/x + d^2*sin((c*
x + d)/x))*b/((c - (c*x + d)/x)*d)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int a+b\,\sin \left (c+\frac {d}{x}\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b*sin(c + d/x),x)

[Out]

int(a + b*sin(c + d/x), x)

________________________________________________________________________________________